package ProducerAndConsumer;

/**
 * @Author: ylc
 * @Description:生产者
 * @Date Created in 2022-05-14 18:00
 */
public class Producer implements Runnable{
    private Storage storage;

    public Producer(){
    }

    public Producer(Storage storage){
        this.storage = storage;
    }

    @Override
    public void run() {
        try {
            Thread.sleep(1000);
            storage.produce();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
